The American Mathematics College is holding its orientation for incoming freshmen. The incoming freshman class contains fewer than $500$ people. When the freshmen are told to line up in columns of $23$, $22$ people are in the last column. When the freshmen are told to line up in columns of $21$, $14$ people are in the last column. How many people are in the incoming freshman class?
Answer: If $n$ is the number of people in the incoming class, then $n$ yields a remainder of $14$ when divided by $21$. Since both 21 and 14 are divisible by 7, this means that $n$ is divisible by $7$. Define $k=n/7$, and note that $7k \equiv 14\pmod{21}$. Dividing by 7, we get $k\equiv 2\pmod{3}$. Multiplying by 7 again, we get $n\equiv 14\pmod{3}$, which implies $n\equiv 2\pmod{3}$. So we are looking for a solution to the following system of linear congruences: \begin{align*}
n&\equiv 0 \pmod{7}, \\
n&\equiv 2 \pmod{3},\\
n&\equiv 22 \pmod{23}. \\
\end{align*} First, we look for a solution to the last two congruences. Checking numbers that are one less than a multiple of 23, we find that 68 satisfies $n\equiv 2\pmod{3}$. By the Chinese Remainder Theorem, the integers $n$ which satisfy both of the last two congruences are precisely those that differ from 68 by a multiple of $3\cdot 23=69$. Checking $68+69$, $68+2\cdot 69$, etc. we find that $68 + 5\cdot 69 = \boxed{413}$ is the least positive solution to the last two congruences which is also divisible by 7. Note that, by the Chinese remainder theorem again, the solutions of the above system of three congruences are precisely the positive integers that differ from 413 by a multiple of $7\cdot3\cdot23=483,$ so 413 is indeed the only solution between 0 and 500.